#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include "input.h"
#include "command.h"

/*
 * This is a dummy module that is/was a debug point
 * between the two main modules input and command
 */

void runCommand(Cmdline* cmdl)
{
  
   /* int i; 
   printf("Running command:[%s]\n", cmdl->cmd);
   printf("    Arugments:[%d]\n", cmdl->argc);
   for(i=0; i < cmdl->argc; i++){
      printf("        Arg:[%s]\n", (char*) cmdl->argv[i]);
   } 
   if(cmdl->runInBackground){
      printf("    InBackground:YES\n");
   } else {
      printf("    InBackground:NO\n");
   }
   if(NULL != cmdl->stdout_dest)
      printf("    Send STDOUT(>) to [%s]\n", cmdl->stdout_dest);
   if(NULL != cmdl->stdin_src)
      printf("    Input STDIN(<) from [%s]\n", cmdl->stdin_src);

   fflush(stdout); */

   /*run command based on command's type */
   if(cmdl->runInBackground)
   {
      cmd_background(cmdl);
   }
   else
   {
      cmd_run(cmdl);
   } 



}
